From 6a47cb4165e317721d0ebb7ff8bc33c53fa265dd Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 10 Jun 2025 14:01:27 +0000 Subject: refactor: remove Pagination component and restructure blog page - Deleted the Pagination component as it is no longer needed. - Refactored the blog page to directly display posts without pagination. - Introduced a new index page to list all blog posts in a single view. --- src/pages/[...page].astro | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 src/pages/[...page].astro (limited to 'src/pages/[...page].astro') diff --git a/src/pages/[...page].astro b/src/pages/[...page].astro deleted file mode 100644 index 6d513b2..0000000 --- a/src/pages/[...page].astro +++ /dev/null @@ -1,33 +0,0 @@ ---- -import type { GetStaticPaths, InferGetStaticPropsType } from "astro"; -import { getCollection } from "astro:content"; -import Layout from "../layouts/BaseLayout.astro"; -import Pagination from "../components/Pagination.astro"; -import PostSummary from "../components/PostSummary.astro"; - -type Props = InferGetStaticPropsType; - -export const getStaticPaths = (async ({ paginate }) => { - const posts = await getCollection("blog", ({ data }) => { - return data.draft !== true; - }); - - posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()); - - return paginate(posts, { - pageSize: 10, - }); -}) satisfies GetStaticPaths; - -const { page } = Astro.props; ---- - - -
- {page.data.map((post) => )} -
- -
- -
-
-- cgit v1.2.3